import request from '@/utils/request'
import data from "@/views/system/dict/data";


// 查询列表
export function getList(query) {
  return request({
    url: '/amac/customerContract/list',
    method: 'get',
    params: query
  })
}

//新增/修改保存
export function addOrUpdate(data) {
  return request({
    url: '/amac/customerContract/addOrUpdate',
    method: 'put',
    data: data
  })
}

// 删除
export function deleteByIds(ids) {
  return request({
    url: '/amac/customerContract/' + ids,
    method: 'delete'
  })
}






// 获取附件列表
export function getPerformanceAttachments(queryParams) {
  return request({
    url: '/amac/customerContract/attachmentList',
    method: 'get',
    params: queryParams
  })
}

// 更新附件列表
export function updateAttachments(data) {
  return request({
    url: '/amac/customerContract/save',
    method: 'post',
    data: data
  })
}

// 获取附件列表-报价
export function getPerformanceAttachmentsPrice(queryParams) {
  return request({
    url: '/amac/customerContract/attachmentListPrice',
    method: 'get',
    params: queryParams
  })
}

// 更新附件列表-报价
export function updateAttachmentsPrice(data) {
  return request({
    url: '/amac/customerContract/savePrice',
    method: 'post',
    data: data
  })
}

// 上传附件
export function uploadAttachment(file) {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: '/amac/customerContract/upload',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
